package org.infodavid.common;

import java.util.Locale;

/**
 * The interface IMessages.
 */
public interface IMessages {
	/** VARIABLE_SYMBOL. */
	String VARIABLE_SYMBOL = "%";

	/**
	 * Gets a string for the given key from this resource or null if associated value was not found.<br>
	 * The value can contain other resources described by '%key' where key is the key of the other
	 * resource.<br>
	 * For example, when retrieving the value "Process has 8 %w in 2 %l" using the code
	 * "getString("key")", the result will be "Process has 8 wafers in 2 lots".<br>
	 * @param key the key for the desired string
	 * @return the string for the given key or null if associated value was not found
	 */
	String getString(String key);

	/**
	 * Gets a string for the given key from this resource or null if associated value was not found.<br>
	 * The value can contain other resources described by '%key' where key is the key of the other
	 * resource.<br>
	 * For example, when retrieving the value "Process has 8 %w in 2 %l" using the code
	 * "getString("key")", the result will be "Process has 8 wafers in 2 lots".<br>
	 * @param key the key for the desired string
	 * @param locale the user locale
	 * @return the string for the given key or null if associated value was not found
	 */
	String getString(String key, Locale locale);

	/**
	 * Gets a string for the given key from this resource or null if associated value was not found.<br>
	 * The value can have variables described by '%n' where n is an integer starting from '0'.<br>
	 * For example, when retrieving the value "Process has %0 wafers in %1 lots" using the code
	 * "getString("key", 8, 2)", the result will be "Process has 8 wafers in 2 lots".<br>
	 * @param key the key for the desired string
	 * @param variables the values to use for replacement of %n variables
	 * @return the string for the given key or null if associated value was not found
	 */
	String getString(String key, Object... variables);

	/**
	 * Gets a string for the given key from this resource or null if associated value was not found.<br>
	 * The value can have variables described by '%n' where n is an integer starting from '0'.<br>
	 * For example, when retrieving the value "Process has %0 wafers in %1 lots" using the code
	 * "getString("key", 8, 2)", the result will be "Process has 8 wafers in 2 lots".<br>
	 * @param key the key for the desired string
	 * @param locale the user locale
	 * @param variables the values to use for replacement of %n variables
	 * @return the string for the given key or null if associated value was not found
	 */
	String getString(String key, Locale locale, Object... variables);

	/**
	 * Gets a long object for the given key from this resource or null if associated value was not
	 * found.
	 * @param key the key for the desired string *
	 * @return the long for the given key or null if associated value was not found
	 */
	Long getLong(String key);

	/**
	 * Gets a double object for the given key from this resource or null if associated value was not
	 * found.
	 * @param key the key for the desired string
	 * @return the double for the given key or null if associated value was not found
	 */
	Double getDouble(String key);

	/**
	 * Gets a boolean object for the given key from this resource or null if associated value was not
	 * found.
	 * @param key the key for the desired string
	 * @return the boolean for the given key or null if associated value was not found
	 */
	Boolean getBoolean(String key);
}
